/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <Atom.h>
#include <lib3d/node/Factory.h>

namespace liba {
namespace lib3d {
namespace node {

template<class T>
class Creator
{
public:
	Creator()
	{
		Factory::add( T::node_name, make_fun );
	}
	~Creator()
	{
		Factory::remove( T::node_name );
	}
	static Node * make_fun( Node * scene_root, const Atom & name)
	{
		return new T( name, scene_root );
	}
};

} // namespace node
} // namespace lib3d
} // namespace liba
using namespace liba;
